﻿// Fill out your copyright notice in the Description page of Project Settings.


#include "ResourceOperation/SoftReference.h"

void ASoftReference::BeginPlay()
{
	Super::BeginPlay();
	if (SoftObjectPath1.IsValid()) { /* 处理*/ }
	if (SoftObjectPath2.IsNull()) { /* 处理*/ }
	if (SoftObjectPath3.IsAsset()) { /* 处理*/ }
	FString SoftObjectPath4_AssetName = SoftObjectPath4.GetAssetName();
	FString SoftObjectPath3_AssetPath = SoftObjectPath3.GetAssetPathString();

	SoftObjectPtr2 = TSoftObjectPtr<AActor>(SoftObjectPath3); //可用 FSoftObjectPath 参数初始化
	// 此处资源未加载，因而判断为false
	if (SoftObjectPtr_Texture2D.IsPending())
	{
		//获取资源
		UTexture2D* MyTexture = SoftObjectPtr_Texture2D.Get();
	}
	//转换成 FSoftObjectPath
	FSoftObjectPath AActorSoftPath1 = SoftObjectPtr_Texture2D.ToSoftObjectPath();

	if (SoftClassPtr_Actor.IsPending())
	{
		UClass* MyActor = SoftClassPtr_Actor.Get();
	}
}
